#pragma once

#if (defined(DEBUG) || defined(_DEBUG)) && defined(AV_WINDOWS)
#	define _CRTDBG_MAP_ALLOC
#	include <crtdbg.h>
#	define new new(_NORMAL_BLOCK, __FILE__, __LINE__)

struct STD_Dump_Memory_leak
{
	STD_Dump_Memory_leak()
	{
		_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF);
	}
	~STD_Dump_Memory_leak()
	{
		_CrtDumpMemoryLeaks();
	}
};
#	define DumpMemoryLeak STD_Dump_Memory_leak ___leak___
#else
#	define DumpMemoryLeak
#endif